/*
  calculate the factorial of a large non-negative number N
*/

#include <cassert>
#include <iostream>
#include <vector>

using namespace std;

int const MAX_DIGIT_LENGTH = 200;

void FactorialOfLargeNumber(int const N) {
    vector<int> product(MAX_DIGIT_LENGTH);
    product[0] = 1;
    // current length of result number
    int digitLength = 0;
    // range [1 .. N + 1)
    for (int i = 1; i < N + 1; ++i) {
        // hold the carry bit
        int carry = 0;

        // actual multiplication of number, digit by digit
        for (int j = 0; j <= digitLength; ++j) {
            product[j] *= i;
            product[j] += carry;
            carry = product[j] / 10;
            product[j] %= 10;
        }

        while (carry) {
            ++digitLength;
            product[digitLength] = carry % 10;
            carry /= 10;
        }
    }
    // reverse display all digits
    for (int i = digitLength; i >= 0; --i) {
        cout << product[i];
    }
    cout << endl;
}

int main() {
    int input;
    cin >> input; // >=0 <= 121
    assert(("Input should be at least 0.", input > -0));
    FactorialOfLargeNumber(input);

    return 0;
}
